{extend name="base"/}

{block name='second_menu'}
{notempty name="$menu[2]"}
<ul class="layui-nav nc-nav">
	{foreach name="$menu[2]" item="second_menu"}
	<li class="layui-nav-item {$second_menu['selected']}">
		<a href="{$second_menu['url']}" {$second_menu['target']}>{$second_menu['title']}</a>
	</li>
	{/foreach}
</ul>
{/notempty}
{/block}

{block name='crumbs'}{/block}
{block name="main"}
<table id="cronexecute_list" lay-filter="cronexecute"></table>
<script type="text/html" id="execute_time">
	<span>{{nc.time_to_date(d.execute_time)}}</span>
</script>
<script type="text/html" id="is_success">
	<span>{{ d.is_success == 1 ? '成功' : '失败'}}</span>
</script>
{/block}

{block name="script"}
<script>
var table = new Table({
	elem: '#cronexecute_list',
	where: {cron_id: "{$cron_id}"},
	url: '{:url("admin/cron/cronexecutelist")}',
	cols: [
		[
			{
			    field: 'cron_name',
			    title: '任务名称'
			},
			{
			    field: 'cron_hook',
			    title: '任务钩子'
			},
			{
			    field: 'cron_addon',
			    title: '任务插件'
			},
			{
			    field: 'execute_time',
			    title: '执行时间',
			    templet: '#execute_time',
			},
			{
			    field: 'is_success',
				title: '是否成功',
				align: 'right',
			    templet: '#is_success',
			}
		]
	]
});
</script>
{/block}